;(function () {
	// 步骤3：创建echarts实例
	let myChart = echarts.init(document.querySelector('.left>.item1'))
	let getArr = function (n) {
		let res = []
		for (let i = 0; i < n; i++) {
			res.push(Math.floor(Math.random() * 100))
		}
		return res
	}
	let option = {
		title: {
      text: '标题样式',
      textStyle: {
        color:'#fff'
      }
		},
		xAxis: {
			// type: 'category',
			// data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
			show: false,
		},
		grid: {
			left: 80,
		},
		yAxis: {
			// type: 'value'
			type: 'category',
			data: new Array(11).fill('字段名称'),
			axisTick: {
				//y轴刻度线
				show: false,
			},
			axisLine: {
				//坐标轴轴线
				show: false,
			},
			//  去掉背景的网格线
			axisLabel: {
				show: true,
				textStyle: {
					color: '#9a9fb4',
					fontSize: 14,
				},
			},
		},
		series: [
			{
				data: getArr(11),
				type: 'bar',
				showBackground: true,
				color: '#6abaf2',
				backgroundStyle: {
					color: '#1e2a6a',
				},

				itemStyle: {
					normal: {
						label: {
							formatter: '{c}%',
							show: true,
							position: 'outside',
							textStyle: {
								color: '#65b1e9',
								fontWeight: 'bold',
							},
						},
					},
				},
			},
		],
	}

	myChart.setOption(option)

	window.addEventListener('resize', () => {
		myChart.resize()
	})
})()
